package mapper;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.bean.EmpInfo;
import org.example.bean.PageInfo;

import java.util.List;

public interface EmpMapper {
    @Select("select * from emp where empState=1 limit #{start},#{size}")
    List<EmpInfo> findEmpByPage(PageInfo pi);
    @Select("select count(empno) from emp where empState=1")
    int findEmpAllCount();
    @Select("select * from emp where empState=1 and empno=#{empNo}")
    EmpInfo findEmpById(int empNo);
    @Update("update emp set ename=#{ename},job=#{job},mgr=#{mgr},hireDate=#{hireDate},sal=#{sal},comm=#{comm} where empNo=#{empNo}")
    void updateEmp(EmpInfo ei);
}
